
import type { newsAddParams, newsListReturnData } from "../type/news"
import type { StoreservicesListData } from "../type/stores"
import http from "../utils/request"

// 类型
export const newstypeList = () => http.get<StoreservicesListData>('/newstype/list')
// 列表
export const newsList = (data: any) => http.get<newsListReturnData>('/news/list', data)
// 单个删除
export const newsDelete = (id: number) => http.get<newsListReturnData>('/news/delete', { id })
// 批量删除
export const newsDeleteAll = (ids: number[]) => http.post<newsListReturnData>('/news/deleteall', { ids })
// 添加
export const newsAdd = (params: newsAddParams) => http.post<newsListReturnData>('/news/add', params)
// 修改
export const newsGet = (id: number) => http.get<newsAddParams>('/news/get', { id })
